package com.tsunami.authority.entity.auth;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.tsunami.base.entity.Entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * <p>
 * 资源表
 * </p>
 *
 * @author lx
 * @since 2021-09-23
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@TableName("tnm_auth_resource")
@ApiModel(value="Resource", description="资源表")
public class Resource extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "租户号")
    @TableField(value = "tenant_id")
    private Long tenantId;

    @ApiModelProperty(value = "服务编码")
    @TableField(value = "server")
    private String server;

    @ApiModelProperty(value = "资源编码")
    @TableField(value = "code")
    private String code;

    @ApiModelProperty(value = "接口名称")
    @TableField(value = "name")
    private String name;

    @ApiModelProperty(value = "菜单ID")
    @TableField(value = "menu_id")
    private Long menuId;

    @ApiModelProperty(value = "请求方式")
    @TableField(value = "method")
    private String method;

    @ApiModelProperty(value = "请求url")
    @TableField(value = "url")
    private String url;

    @ApiModelProperty(value = "接口描述")
    @TableField(value = "describe_")
    private String describe;

    @Builder
    public Resource(Long id, Long createUser, LocalDateTime createTime, Long updateUser, LocalDateTime updateTime,
                    String code, String name, Long menuId, String describe, String method, String url) {
        this.id = id;
        this.createUser = createUser;
        this.createTime = createTime;
        this.updateUser = updateUser;
        this.updateTime = updateTime;
        this.code = code;
        this.name = name;
        this.menuId = menuId;
        this.describe = describe;
        this.method = method;
        this.url = url;
    }

}
